import { defineStore } from 'pinia'
import { ref } from 'vue'
import { recogUploadService } from '../../api/recog'

export const useRecogStore = defineStore(
  'recognition',
  () => {
    const detectedImage = ref()
    const getDetectedImage = async (file) => {
      const res = recogUploadService(file)
      detectedImage.value = res.data.data
    }

    return {
      detectedImage,
      getDetectedImage
    }
  },
  { persist: true }
)
